package com.xy.excel;

import com.xy.entity.BlacklistEntity;
import com.xy.service.IBlacklistService;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.core.tool.utils.BeanUtil;

import java.util.List;


@RequiredArgsConstructor
public class BlacklistImporter implements ExcelImporter<BlacklistExcel>  {
	private final IBlacklistService blacklistService;
	@Override
	public void save(List<BlacklistExcel> data) {

		List<BlacklistEntity> entityList = BeanUtil.copy(data, BlacklistEntity.class);

		blacklistService.importBlacklis(entityList);

	}
}
